/*
 *  Laboratorio de Finanzas Computacionales
 */

package bm.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

import bm.data.Libro;
import bm.forms.LibroForm;


public class AddLibro extends Action {
    
    
    public ActionForward execute(ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        
        LibroForm libroForm = (LibroForm) form;
        Libro libro = libroForm.getLibro();
        

        this.almacenarLibro(libro);
        
        request.setAttribute("libro", libro);
        
        
        return mapping.findForward("verLibro");
    }
    
    
    
    private void almacenarLibro(Libro libro){
        // Persistencia de datos
    }
    
}
